<template>
    <el-dialog
            id="logDialog"
            title="日志"
            :visible.sync="logVisible"
            :close-on-click-modal="false"
            width="40%"
            style="height: 60%; overflow: hidden"
            v-dialogDrag>
        <div style="overflow: hidden; white-space: pre-line;">
            <p style="overflow: auto;max-height: 380px;margin-bottom: 10px">{{res}}</p>
        </div>
    </el-dialog>
</template>

<script>
    export default {
        name: "logDialog",
        data() {
            return {
                logVisible:false,
                res:""
            }
        },
        props: {
            // dataPost: {
            //     type: Object,
            //     default: function () {
            //         return {
            //             visible: false,
            //             res: ''
            //         }
            //     }
            // }
        },
        created() {
            let that = this;
            this.$Bus.$on('log', res => {
                that.logVisible = res.visible;
                that.res = res.data;
            })
        }
    }
</script>

<style>
    #logDialog .el-dialog__body {
        padding: 20px
    }
</style>